import com.google.appengine.api.datastore.*
import static com.google.appengine.api.datastore.FetchOptions.Builder.*
 
// query the scripts stored in the datastore
def query = new Query("Concello")
 
query.addSort("nome", Query.SortDirection.ASCENDING) 
PreparedQuery preparedQuery = datastore.prepare(query)

 
// return only the first 20 results
def entities = preparedQuery.asList(withLimit(400) )

/*html.ul(class: 'imagenes') {
    li { b "Concellos: " }
    entities.each {concello ->
        if (concello) {
            li {
                span class: 'concello', {
                	a href:"verConcello.groovy?id=${concello.key?.id}", "${concello.nome}"
                }
            }
        }
    }
}*/

html.select(id:'concello', name:'concello') {
	entities.each {concello->
		if (concello) {
			option value:"${concello.key?.id}","${concello.nome}"
		}
	}

}

